package com.csun.cmny.provider.service;

import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.UacGroupRoleMenu;
import com.csun.cmny.provider.model.domain.UacMenu;
import com.csun.cmny.provider.model.domain.UacRoleMenu;
import com.csun.cmny.provider.model.dto.group.*;
import com.csun.cmny.provider.model.vo.BindAuthVo;
import com.csun.cmny.provider.model.vo.MenuVo;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-07-21 13:03
 * @Description: the interface uac group role menu service
 */
public interface UacGroupRoleMenuService extends IService<UacGroupRoleMenu> {

    /**
     * 批量移除机构角色菜单
     *
     * @param groupRoleMenuListDto  the group role menu list dto
     *
     * @return  the int.
     */
    Integer batchDeleteRoleMenu(GroupRoleMenuListDto groupRoleMenuListDto);

    /**
     * 分配机构角色菜单
     *
     * @param groupRoleAssignMenuDto    the group role assign menu dto
     *
     * @return  the int.
     */
    Integer assignRoleMenu(GroupRoleAssignMenuDto groupRoleAssignMenuDto);

    /**
     * 查询角色菜单列表-分页查询
     *
     * @param groupMenuQueryDto the group menu query dto
     *
     * @return  the page info.
     */
    PageInfo queryRoleMenuListWithPage(GroupMenuQueryDto groupMenuQueryDto);

    /**
     * 批量添加机构角色菜单
     *
     * @param groupId           the group id
     * @param uacRoleMenuList   the role menu list
     *
     * @return  the int.
     */
    Integer batchSaveGroupRoleMenu(Long groupId, List<UacRoleMenu> uacRoleMenuList);

    /**
     * get group role menu tree
     *
     * @param groupRoleDto  the group role dto
     *
     * @return  the bind auth vo
     */
    BindAuthVo getGroupRoleMenuTree(GroupRoleDto groupRoleDto);

    /**
     * 查询机构角色选中的菜单Id列表
     *
     * @param groupRoleDto  the group role dto
     *
     * @return  the list.
     */
    List<Long> getCheckedMenuList(GroupRoleDto groupRoleDto);

    /**
     * 查询角色-菜单数量
     *
     * @param roleId        the role id
     * @param menuIdList    the menu id list
     *
     * @return  the int.
     */
    int selectCountRoleIdAndMenuIdList(Long roleId, List<Long> menuIdList);

    /**
     * query menu list by group id and user id
     *
     * @param groupId   the group id
     * @param userId    the user id
     *
     * @return  the list.
     */
    List<MenuVo> queryMenuListByGroupIdAndUserId(Long groupId, Long userId);
}
